package puzzle.projecteuler.p200;


public class Problem197C {

	/**
	 * 试算后发现：k>=208
	 * f(2k) 	=  1.029461839
	 * f(2k+1) 	=  0.681175878
	 * 
	 * answer	: 1.710637717
	 * time cost: 0ms 
	 * @param args
	 */
	public static void main(String[] args) {
		
		long s = System.currentTimeMillis();
		
		double u = -1.0f;
		for (int i = 0; i < 1000; i ++) {
			u = f(u);
			System.out.println((i+1) + " = " + u);
		}
		
		System.out.println(1.029461839 + 0.681175878);

		System.out.println((System.currentTimeMillis()-s) + " ms");
	}
	
	private static double f(double x) {
		
		double x2 = x*x;
		double pow = 30.403243784-x2;
		return Math.floor(Math.pow(2.0, pow))*0.000000001;
	}
}
